package Test03;

public abstract class Employee {
    /*private成员变量name,number,birthday，其中birthday 为MyDate类的对象；
    abstract方法earnings()；
    toString()方法输出对象的name,number和birthday。*/
	
	private String name;
	private int number;
	//其中birthday 为MyDate类的对象 解读  将MyDate赋值给birthday  作为birthday 类型
	private MyDate birthday; // 错误  数据类型错误 应为MyDate 
	
	public Employee() {

	}
	
	public Employee(String name, int number,MyDate my) {
		this.name = name;
		this.number = number;
		this.birthday = my; //原来写的是 my.toString
	}


	public abstract double earnings();

	@Override
	public String toString() {
		return "姓名=" + name + ", 编号=" + number + ", 生日=" + birthday;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public MyDate getBirthday() {
		return birthday;
	}

	public void setBirthday(MyDate birthday) {
		this.birthday = birthday;
	}

	
	

}
